package com.zlp.mall.modules.cms.controller;


import com.zlp.mall.common.api.R;
import com.zlp.mall.modules.cms.dto.resp.PrefrenceAreaResp;
import com.zlp.mall.modules.cms.service.PrefrenceAreaService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequiredArgsConstructor
@RequestMapping("/prefrenceArea")
@Api(value = "PrefrenceAreaController", tags = "商品优选管理")
public class PrefrenceAreaController {

    private final PrefrenceAreaService prefrenceAreaService;

    @ApiOperation("获取所有商品优选")
    @GetMapping(value = "/listAll")
    public R<List<PrefrenceAreaResp>> listAll() {

        List<PrefrenceAreaResp> prefrenceAreaList = prefrenceAreaService.listAll();
        return R.success(prefrenceAreaList);
    }
}
